@(title: String, activeNav: String = "", keywords: String = App.siteSetting.seoKeyword, description: String = App.siteSetting.seoDescription)(content: Html)(implicit request: RequestHeader)

@import helper._
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>@title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta property="og:site_name" content="@App.siteSetting.name"/>
    <meta property="og:description" content="@App.siteSetting.seoDescription"/>
    <meta name="keywords" content="@keywords">
    <meta name="description" content="@description">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_mqhl04idhqx8byb9.css">
    <link rel="stylesheet" href="/assets/layui/css/layui.css">
    <link rel="stylesheet" href="/assets/css/global.css">
    <link rel="shortcut icon" href="@App.siteSetting.favicon"/>
</head>
<body>

<div class="header">
    <div class="main">
        <a class="logo" href="/" title="Fly" style="width:220px;height:40px;background: url(@App.siteSetting.logo) no-repeat;">@App.siteSetting.name</a>
        <div class="nav">
            <a class='@if(activeNav == "doc"){nav-this}' href="/docs">
                <i class="iconfont icon-iconmingxinganli" style="top: 2px;"></i>学习
            </a>
            <a class='@if(activeNav == "article"){nav-this}' href="/articles">
                <i class="iconfont icon-logo" style="top: 2px;"></i>分享
            </a>
            <a class='@if(activeNav == "qa"){nav-this}' href="/qas">
                <i class="iconfont icon-wenda" style="top: 2px;"></i>问答
            </a>
            <a class='@if(activeNav == "tweet"){nav-this}' href="/tweets">
                <i class="layui-icon" style="top: 2px;">&#xe60c;</i>说说
            </a>
            <a href="https://github.com/playcommunity/play-community" target="_blank">
                <i class="iconfont icon-daima" style="top: 2px;"></i>源码
            </a>
        </div>

        <div class="nav-user">

            @request.session.get("name") match {
                case Some(name) => {
                    <!-- 登入后的状态 -->
                    <a class="avatar" href="/user/home">
                        <img src="@request.session("headImg")">
                        <cite>@name</cite>
                        <!--<i>VIP2</i>-->
                    </a>
                    <div class="nav">
                        <a href="/user/setting"><i class="iconfont icon-shezhi"></i>设置</a>
                        <!--<a href="/user/message"><i class="iconfont icon-xiaoxi"></i>消息</a>-->
                        <a href="/logout"><i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>退了</a>
                    </div>
                }
                case None => {
                    <!-- 未登入状态 -->
                    <a class="unlogin" href="javascript:void(0);"><i class="iconfont icon-touxiang"></i></a>
                    <span><a href="/login">登入</a><a href="/register">注册</a></span>
                    <!--<span><a href="https://cloud.chatbot.cn/cloud/login">公有云登入</a><a href="https://vip.chatbot.cn/cloud/login">企业云登入</a></span>-->
                    <!--<p class="out-login">
                        <a href="" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-qq" title="QQ登入"></a>
                        <a href="" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-weibo" title="微博登入"></a>
                    </p>-->
                }
            }
        </div>
    </div>
</div>
@content
<div class="footer">
    <p><a href="@App.siteSetting.url">@App.siteSetting.name</a> 2017 &copy; <a href="http://www.playscala.cn">PlayScala社区</a></p>
    <!--<p>
        <a href="https://www.chatbot.cn/demo.html" target="_blank">产品演示</a>
        <a href="https://cloud.smartnlp.cn/cloud/register" target="_blank">产品体验</a>
        <a href="javascript:void(0);" target="_blank">微信公众号</a>
    </p>-->
</div>
<script src="/assets/js/jquery.js"></script>
<script src="/assets/layui/layui.js"></script>
<script src="/assets/js/vue.js"></script>
<script>
var activeNav = "doc";
var isDoc = true;
var token = '@CSRF.getToken.value';

layui.cache.user = {
  username: '@request.session.get("name").getOrElse("游客")'
  ,uid: @request.session.get("uid").getOrElse("-1").toInt
  ,avatar: '@request.session.get("headImg").getOrElse("/assets/images/head.png")'
  ,experience: 0
  ,sex: '男'
};
layui.config({
  version: "2.0.0"
  ,base: '/assets/mods/'
}).extend({
  fly: 'index'
}).use('fly', function(){
  var $ = layui.jquery;
  var fly = layui.fly;
});

</script>
</body>
</html>
